<?php
class CmsAdminContainerControl extends CmsBaseControl
{
    protected $content = array();
    protected $sideBar = array();

    public function CmsAdminContainerControl()
    {
        parent::__construct();
        $this->SetReplace('sidebar', null);
    }

    public function Render()
    {
        $content = implode('', $this->content);
        $this->SetReplace('content', $content);
        if (!empty($this->sideBar))
        {
            $content = implode('', $this->sideBar);
            $content = "<td style='border-left:1px dashed rgb(204, 204, 204);padding:13px' valign='top' width='22%'>$content</td>";
            $this->SetReplace('sidebar', $content);
        }

        $this->Replace($this->replace);
        return parent::Render();
    }

    public function SetSelected($selected)
    {
        $this->selected = $selected;
    }

    public function SetReplace($key, $value)
    {
        $this->replace[$key] = $value;
    }

    public function AddContent($content)
    {
        $this->content[] = "<div>$content</div>";
    }

    public function AddSideBar($content)
    {
        $this->sideBar[] = "<div>$content</div>";
    }}
?>